package com.peza.bikelog.business.convertor;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.log4j.Logger;

import com.peza.bikelog.business.service.GarminService;
import com.peza.bikelog.business.service.impl.GarminServiceImpl;

public class GarminConverter {

	private static final String INPUTDIRTCX = "/Users/Peter/Garmin/";
	private static final String INPUTDIR = "/Users/Peter/Garmin/exports/";
	private static final String INPUTFILE = "Peter_tcdatabasebackup_201100316.tcx";
	private static final String OUTPUTDIR = "/Users/Peter/Garmin/exports/";
	private static final String POLARDIR = "/Users/Peter/Polar/Peter Derveaux/";
	

	private static Logger logger = Logger.getLogger("Converter.class");

	
	
	public static void main(String[] args) {
		System.out.println("Starting main...");
		GarminService gs = new GarminServiceImpl();
		System.out.println("Separating activities...");
		gs.separateActivities(INPUTDIRTCX, INPUTFILE, OUTPUTDIR, "2008");		
		
		
//		File garminDir = new File(INPUTDIR);
//		List<File> files = Arrays.asList(garminDir.listFiles());
//		List<File> garminFiles = new ArrayList<File>();
//		
//		for (File f : files){
//			if (f.getName().endsWith("200903221-exported.tcx")){
//				garminFiles.add(f);
//				gs.matchGarminWithPolar(f.getAbsolutePath(), POLARDIR);
//			} 
//		}
	}
	
}
